import 'package:flutter/widgets.dart';

enum Visible {
  visible,
  invisible,
  gone,
}

class VisibleView extends StatelessWidget {
  bool? visible;
  final Widget? child;

  VisibleView({super.key,
    @required this.child,
    this.visible = true,
  });

  @override
  Widget build(BuildContext context) {
    visible = visible ?? true;

    return Visibility(
        visible: visible != false,
        child: Opacity(
            opacity: visible == true ? 1.0 : 0.0,
            child: child));
  }
}